static gboolean
list_loose_objects_at (OstreeRepo *self,
+ GVariant *dummy_value,
GHashTable *inout_objects,
int dfd,
const char *prefix,
GCancellable *cancellable,
GError **error)
{
- GVariant *key, *value;
+ GVariant *key;
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
gboolean exists;
}
key = ostree_object_name_serialize (buf, objtype);
- value = g_variant_new ("(b@as)",
- TRUE, g_variant_new_strv (NULL, 0));
+
/* transfer ownership */
g_hash_table_replace (inout_objects, g_variant_ref_sink (key),
- g_variant_ref_sink (value));
+ g_variant_ref (dummy_value));
}
return TRUE;
GError **error)
{
static const gchar hexchars[] = "0123456789abcdef";
+ // For unfortunate historical reasons we emit this dummy value.
+ g_autoptr(GVariant) dummy_loose_object_variant =
+ g_variant_ref_sink (g_variant_new ("(b@as)", TRUE, g_variant_new_strv (NULL, 0)));
for (guint c = 0; c < 256; c++)
{
buf[0] = hexchars[c >> 4];
buf[1] = hexchars[c & 0xF];
buf[2] = '\0';
- if (!list_loose_objects_at (self, inout_objects, self->objects_dir_fd, buf,
+ if (!list_loose_objects_at (self, dummy_loose_object_variant,
+ inout_objects, self->objects_dir_fd, buf,
commit_starting_with,
cancellable, error))
return FALSE;